package com.aicheyoudao;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

public class MainActivity extends Activity implements OnClickListener {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main_layout);
		initView();
	}

	private void initView() {
		TextView gasstation = (TextView) findViewById(R.id.gasstation);
		gasstation.setOnClickListener(this);
		TextView carport = (TextView) findViewById(R.id.carport);
		carport.setOnClickListener(this);
		TextView navigation = (TextView) findViewById(R.id.navigation);
		navigation.setOnClickListener(this);
		TextView shop = (TextView) findViewById(R.id.shop);
		shop.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		String searchKey = "";
		switch (v.getId()) {
		case R.id.gasstation:
			searchKey="加油站";
			break;

		case R.id.navigation:
			searchKey="加油站";
			break;

		case R.id.carport:
			searchKey="停车场";
			break;

		case R.id.shop:
			searchKey="4S店";
			break;
		}

		Intent intent = new Intent(MainActivity.this, MainMap.class);
		intent.putExtra("searchKey", searchKey);
		MainActivity.this.startActivity(intent);
	}

}
